Class ActionsList
- java.lang.Object
-
- page.codeberg.terratactician_expandoria.bots.actions.ActionsList
-
public class ActionsList extends java.lang.ObjectA list of action, to be send to the game together. Sending a action list indicates the end of a challenge tick.
-
-
Constructor Summary
Constructors Constructor Description ActionsList()Creates an empty ActionsListActionsList(java.util.List<Action> list)Creates a ActionList from a Actions list.ActionsList(Action act)Creates a ActionList from a single action.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(Action action)Adds one action to the action list.intlimitedSize()Returns the number of action that are part of the action limit.java.lang.Stringserialize()serializes the action list to a json stringintsize()amount of action in the action list.
-
-
-
Constructor Detail
-
ActionsList
public ActionsList()
Creates an empty ActionsList
-
ActionsList
public ActionsList(java.util.List<Action> list)
Creates a ActionList from a Actions list.- Parameters:
list- action list
-
ActionsList
public ActionsList(Action act)
Creates a ActionList from a single action.- Parameters:
act- action list
-
-
Method Detail
-
add
public void add(Action action)
Adds one action to the action list.- Parameters:
action- action to add
-
size
public int size()
amount of action in the action list.- Returns:
- amount of actions
-
limitedSize
public int limitedSize()
Returns the number of action that are part of the action limit.- Returns:
- amount of limited actions
-
serialize
public java.lang.String serialize()
serializes the action list to a json string- Returns:
- json string
-
-